#include <iostream>
#include <vector>
#include<unistd.h>
#include<stdlib.h>

int main(int argc, char*argv[]) {
    if (daemon(0,0) == -1) {
        std::cerr << "daemonize failed" << std::endl;
        exit(-1);
    }

    while(1) {
        sleep(1);
        std::cout << "Daemon running..." << std::endl;
    }
    return 0;
}